using System;

namespace Tiwo.Design.ItemRenderers
{
    [Flags]
    public enum ResizeDirection
    {
        Top = 1,
        Left = 2,
        Bottom = 4,
        Right = 8
    }

    public static class ResizeDirectionExtension
    {
        public static bool Has(this ResizeDirection direction, ResizeDirection value)
        {
            return (direction & value) == value;
        }

        public static bool IsVertical(this ResizeDirection direction)
        {
            return direction == ResizeDirection.Top || direction == ResizeDirection.Bottom;
        }

        public static bool IsHorizontal(this ResizeDirection direction)
        {
            return direction == ResizeDirection.Left || direction == ResizeDirection.Right;
        }
    }
}